@echo off
chcp 65001

:: 保存当前路径
set "current_path=%cd%"

:: 切换到 %temp% 路径
cd /d "%temp%"

:: 定义文件路径
set "pythonpath_file=pythonpath.txt"

:: 检查文件是否存在
if not exist "%pythonpath_file%" (
    echo 文件 %pythonpath_file% 不存在,请配置该文件
    pause
    cd /d "%current_path%"  :: 切换回原来的路径
    exit /b
)

:: 读取文件内容
for /f "delims=" %%i in (%pythonpath_file%) do (
    set "exe=%%i"
    goto :end_for
)
:end_for

:: 切换回原来的路径
cd /d "%current_path%"

@REM cd src



@REM 这个位置执行 dir /b *.py 命令捕获最后一个 Python 文件的路径
for /f "delims=" %%i in ('dir /b *.py') do (
    set "last_python_file=%%i"
)


echo 当前 Python 脚本最新版本为 : %last_python_file%

%exe% -B "%last_python_file%"

pause